package com.cloud.sys.modules.sys.controller;

import com.cloud.sys.modules.sys.client.IFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

//    @Value("${server.port}")
//    String port;

    @Autowired
    private IFeignClient iFeignClient;

    @GetMapping("test")
//    @HystrixCommand(fallbackMethod = "fallback")
    public String test(@RequestParam("name") String name){
        return iFeignClient.hello(name);
    }

    public String fallback(String name){
       return "报错了";
    }

    @GetMapping("consumer")
    public String consumer(){
        return "service from";
    }
}
